We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

$this->request->getDelete() ?

How to get data from DELETE request? I see on stackoverflow the process to get data from DELETE request is same with the process to get data from PUT request. I have tried $thiis->request->getPut() it is not working.



33.8k
Accepted
answer

$this->request->getPut() works. But you are right, there isn't a getDelete() method. Try using $this->request->get() to maybe get a workaround.

@phalcon



98.9k

That depends on how you pass the data from the client, if you do so in JSON, $this->request->getPut() should work for you



7.9k
edited Nov '14

I have tried JSON data, it also not working, $this->request->getPut() always return null

That depends on how you pass the data from the client, if you do so in JSON, $this->request->getPut() should work for you



7.9k

using query string as @RompePC described :)

thanks everyone